# Contributor:
# Maintainer:
pkgname=cfssl
pkgver=1.4.1
pkgrel=1
pkgdesc="Cloudflare PKI and TLS toolkit"
url="https://cfssl.org"
arch="all"
license="BSD-2-Clause"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/cloudflare/cfssl/archive/v$pkgver.tar.gz"

build() {
	cd "$srcdir"

	mkdir -p src/github.com/cloudflare
	cp -r "$builddir" src/github.com/cloudflare/cfssl

	export GOPATH="$PWD"
	go install -tags pkcs11 github.com/cloudflare/cfssl/cmd/...
}

package() {
	cd "$srcdir"/bin

	mkdir -p "$pkgdir"/usr/bin
	install -m755 "$srcdir"/bin/* "$pkgdir"/usr/bin/
}

sha512sums="0aa557708a300e2eaf48a99d55794069530b6842584cdd867a864272b205c89d5abc2acf3a19d34b3b5519a6429b5f55685129638e65d574ad6afe5b7e1e1e8f  cfssl-1.4.1.tar.gz"
